﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Xejen.Database.Ef
{
    /// <summary>
    /// 表示事务工作单元
    /// </summary>
    /// <creator>marc</creator>
    public interface IUnitOfWork : IDisposable
    {
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <returns></returns>
        Task<int> SaveChangesAsync();
        /// <summary>
        /// 开始事务
        /// </summary>
        void BeginTransaction();
        /// <summary>
        /// 接受事务
        /// </summary>
        void Commit();
        /// <summary>
        /// 回滚事务
        /// </summary>
        void Rollback();
    }
}
